It is possible to link with each other several packet-switched networks (LAN=Local Area Network) or segments of the one and same LAN via “intelligent” bridges or multiport bridges (switches). When this is done, the bridges can autonomously detect the logical topology of the network by means of the data packets (data frames) passing through them, by using the layer 2 addresses of the bridges in the network (MAC addresses, MAC=Medium Access Control).
In a switched network there should only ever be one single network path which is active for the exchange of data between two bridges, because if there are path loops it is possible for data packets to be duplicated, which is unwanted, and for multiple copies to be forwarded to the destination, which can lead to malfunctions and reduces the performance of the communication network.
IEEE Standard 802.1d establishes a standard for a network protocol called STP (STP=Spanning Tree Protocol), by which a logical topology is set up, in the form of a loop-free spanning tree, which links together the bridges of the communication network. During the setting up of the spanning tree, no payload data (subscriber data) can be transmitted.
In STP, identifiers are issued for all the bridges in the network (bridge IDs), consisting in each case of the layer 2 address (MAC address) of the bridge and a priority field. In the same way, each connection (port) is assigned an identifier (port ID) and a path cost.
In STP, the ports can assume different states, namely a “blocking” state in which only configuration frames, called BPDUs (BPDU=Bridge Protocol Data Unit), are accepted by the bridges, a “listening” state, during which the active logical topology is mapped, a “learning” state during which a bridging table is compiled from the MAC addresses which have been read, a “forwarding” state in which the ports are to forward payload data, and a “disabled” state in which ports neither receive nor forward either payload data or BPDUs.
In STP, only the root bridge creates BPDUs, whereas the other bridges do not themselves create any BPDUs, but only forward (relay) BPDUs received from the root bridge. With the help of the data items contained in the BPDUs, the bridges can alter the states of their ports.
Each BPDU contains a series of fields, such as a flag field for indicating or confirming a topology change, a root bridge ID field for identifying the root bridge with details of its priority and ID, a path cost field for specifying the path costs of the root bridge which is transmitting the BPDU, a message age field (MessAge) for specifying the length of time since the BPDU was sent out, a MaxAge field for specifying an interval of time, after the expiry of which the message is to be deleted, a hello time field for specifying the time interval between regular configuration messages from the root bridge, and a forward delay field, which specifies the time to wait after a change to the topology.
In order to form a loop-free logical topology, STP uses four criteria for the purpose of determining the highest priorities of the bridges, or their ports, as applicable. They are: the smallest root bridge ID, the lowest path cost for a root bridge, the smallest transmission bridge ID, and the smallest port ID.
In order to determine a root bridge, in STP all the ports of the bridges go into the “blocking” state after the initialization (for example after a restart of the network), whereby each bridge initially assumes that it is itself a root bridge and transmits to the other bridges an appropriate BPDU, with its own ID as the root bridge ID. After this, the bridge with the lowest root bridge ID is selected as the root bridge. In the event of identical root bridge IDs, the lowest MAC address is used as a supplementary criterion.
After this, all the network paths of the spanning tree over which a data exchange is to take place between the bridges in the communication network are defined, from the selected root bridge outward. For this purpose, the root bridge first transmits BPDUs to the other bridges. Each bridge thereupon determines as its root port that port which has the lowest path cost to the root bridge. In the event that there are path costs which are the same, the port ID is used as a supplementary criterion. Then, on the basis of the path costs, designated ports are determined and the designated bridges in the spanning tree are determined.
In STP, the root bridge informs all the bridges in the spanning tree at regular intervals that it is still there, by means of a BPDU (hello signal). If such a hello signal does not appear, such as because of the failure of a link or the root bridge itself, a reconfiguration (reconvergence) of the communication network is required to determine a new spanning tree, which in STP typically takes at least 30 seconds. During this time only BPDUs, i.e. data packets for the purpose of determining a new spanning tree, are communicated, so that for this period of time the communication network cannot be used for payload data exchange.
Faster reconvergence of the communication network is made possible by the RSTP network protocol (RSTP=Rapid Spanning Tree Protocol), which is standardized in the IEEE Standard 802.1w. In RSTP, alternative ports are determined, which block BPDUs from other bridges and offer an alternative path to the root bridge if the root port should go down. In addition, a proposal/agreement handshake mechanism has been implemented in RSTP.
Whereas STP bridges which are not root bridges will only forward BPDUs if they themselves have beforehand obtained a BPDU from the root bridge, in RSTP bridges themselves also transmit BPDUs at time intervals which can be defined. RSTP specifies that a bridge will lose its link to a neighboring bridge if it cannot receive three BPDUs within this definable time interval. This enables the failure of a link to be recognized more rapidly than in STP. As shown by simulations, the convergence time in RSTP is a few seconds, for example approx. 2 seconds when a link fails and approx. 7 seconds when a root bridge fails.